﻿namespace PdfSdk.PdfViewer
{
    internal class AnnotationWrapperHelper
    {
        public static AnnotationWrapper GetAnnotation(object obj)
        {
            if (obj == null)
                return null;

            return obj.GetType().Name switch
            {
                "PdfViewerFileLinkAnnotation" => new PdfViewerFileLinkAnnotationWrapper(obj),
                "PdfViewerFreeTextAnnotation" => new PdfViewerFreeTextAnnotationWrapper(obj),
                "PdfViewerInkAnnotation" => new PdfViewerInkAnnotationWrapper(obj),
                "PdfViewerPolygonAnnotation" => new PdfViewerPolygonAnnotationWrapper(obj),
                "PdfViewerShapeAnnotation" => new PdfViewerShapeAnnotationWrapper(obj),
                "PdfViewerStampAnnotation" => new PdfViewerStampAnnotationWrapper(obj),
                "PdfViewerStickyNoteAnnotation" => new PdfViewerStickyNoteAnnotationWrapper(obj),
                "PdfViewerTextMarkupAnnotation" => new PdfViewerTextMarkupAnnotationWrapper(obj),
                "PolylineAnnotation" => new PolylineAnnotationWrapper(obj),
                "InkSignature" => new InkSignatureWrapper(obj),
                _ => null,
            };
        }
    }
}
